package viz_ui;

import processing.core.PApplet;
import buttons.DropDownList;
import buttons.control.C_DropDown;
import buttons.view.V_Button;
import controllers.ControlManager;
import utilities.EventListener;
import utilities.EventOwner;
import view.DisplayList;
import viz_main.VizApplet;

public class MappingManager implements EventListener{
	  
  private DropDownList sizeMap;
  private DropDownList colorMap;
  private DropDownList opacityMap;
  private VizApplet parent;
  
  public MappingManager(ControlManager cManager, DisplayList disList, float xLocal, float yLocal, VizApplet p)
  {    
	parent = p;
    // name width height x y
    opacityMap = new DropDownList(disList, cManager, "opacity", 90, 12, xLocal + 160 + 150, yLocal + 5, p);
    opacityMap.addOption("None");
    opacityMap.addOptions(parent.labels);
    opacityMap.addSubscriber(this);
        
    // name width height x y
    colorMap = new DropDownList(disList, cManager, "color", 90, 12, xLocal + 160, yLocal + 5, p);
    colorMap.addOption("None");
    colorMap.addOptions(parent.labels);
    colorMap.addSubscriber(this);    
        
    // name width height x y
    sizeMap = new DropDownList(disList, cManager, "size", 90, 12, xLocal + 10, yLocal + 5, p);
    sizeMap.addOption("None");
    sizeMap.addOptions(parent.labels);
    sizeMap.addSubscriber(this);
  }
  
  public void handleEvent(String trigger, EventOwner obj)
  {
	  /*
      String buttonName = ( (V_Button)((C_DropDown)obj).getView() ).getName();
      if(buttonName.equals("size"))
      {
        parent.mapGlobalSize(trigger);
      }
      else if(buttonName.equals("opacity"))
      {
        parent.mapGlobalOpacity(trigger);
      }
      else if(buttonName.equals("color"))
      {
        parent.mapGlobalColor(trigger);
      }
      */
  }
}
